// 生产领料接口
import request from '@/utils/request'

//生产领料 列表查询
export function GetListAPI(params) {
  return request({
    url: '/storage/productionPicking/list',
    method: 'GET',
    params
  })
}

// 生产领料 新增
export function AddDataAPI(data) {
  return request({
    url: '/storage/productionPicking/addPincking',
    method: 'POST',
    data
  })
}

// 生产领料 查看
export function GetDailtAPI(data) {
  return request({
    url: '/storage/productionPicking/view/' + data,
    method: 'GET'
  })
}

// 生产领料 修改
export function EditDataAPI(data) {
  return request({
    url: '/storage/productionPicking/updateDoc',
    method: 'POST',
    data
  })
}

// 生产领料 关结
export function CloseAPI(data) {
  return request({
    url: '/storage/productionPicking/closeDoc',
    method: 'POST',
    data
  })
}

// 生产领料 生产确定
export function SureAPI(data) {
  return request({
    url: '/storage/productionPicking/confirm',
    method: 'PUT',
    data
  })
}

// 删除生产领料单
export function DelIdAPI(data) {
  return request({
    url: '/storage/productionPicking/deleteDoc/' + data,
    method: 'DELETE'
  })
}

// 导出
export function exportApi(data) {
  return request({
    url: '/storage/pickingComplete/export',
    method: 'POST',
    data
  })
}

// 生产领料明细列表查询
export function GetDetailListAPI(params) {
  return request({
    url: '/storage/stockInfoDetail/list',
    method: 'GET',
    params
  })
}

// 生产领料新增生产计划下拉数据
export function getPlanListAPI(params) {
  return request({
    url: '/order/productPlan/getPlanList',
    method: 'GET',
    params
  })
}

// 根据计划单带出bom需要物料
export function getStockInfoBomAPI(params) {
  return request({
    url: '/order/sales-order/getStockInfoBom',
    method: 'GET',
    params
  })
}

// 生产领料生产计划弹窗列表数据
export function productPlanDropListAPI(params) {
  return request({
    url: '/order/productPlan/productPlanDropList',
    method: 'GET',
    params
  })
}

// 根据计划单带出bom需要物料
export function editStockBomAPI(data) {
  return request({
    url: '/order/sales-order/editStockBom',
    method: 'PUT',
    data
  })
}

/**
 * 生产计划下拉
 * @param {} params
 * @returns
 */
export function selectCoNumberListAPI(data) {
  return request({
    url: '/storage/productionPicking/selectCoNumberList',
    method: 'GET',
    data
  })
}

/**
 * 推送
 * @param {} data
 * @returns
 */
export function pushAPI(data) {
  return request({
    url: '/storage/productionPicking/push',
    method: 'PUT',
    data
  })
}
